home *** CD-ROM | disk | FTP | other *** search
-
-
- Enclosed with my new version of 4XFORTH from the Dragon Group is a little
- thing that I'm going to retype for the BBS. I THINK YOU ARE GOING TO BE
- PLEASED!
- OF MICE AND GEM (hacking the Jackie) by Lt. (j.g.) Christopher Biow, 1924
- Slalom Dr., Virginia Beach, VA 23456 (804) 468-1453
- The Jackintosh may be a semi-closed hardware device, but there is no way
- Atari, DRI, or anyone else will be able to close the software. They have
- tried. After investing a fair chunk of the 520ST's price in a windowing
- operating system with a mouse, ATARI decided to keep the memory addresses
- containing the mouses's absolute secret. Or, maybe DRI didn't even tell
- Atari. In any case, the only provision for using the mouse in programs was a
- C primitive. However, Atari did give us a bit mapped, high resolution screen,
- which makes finding the mouse location simple.
- Briefly, here are the addresses:
- HEX DECIMAL INFORMATION
- Byte at 2418 9240 Least significant bit--Left button
- Second least significant bit--Right button
- Word at 241c 9244 X position of mouse--0 to 639
- Word at 241e 9246 Y position of mouse--0 to 399
- Word at 242e 9262 YX position of mouse--8000 HEX to FCFE HEX
- (32768-64766). This is row-major or
- raster position on the screen.
- Words are 16 bit quantities.
- How did that high-res screen help me find this? Well, the screen is mapped to
- the top 32000 (not 32K--400 rows * 640 col / 8 bits per byte = 32000) bytes of
- memory. 512K = 524,288 - 32,000 = 492,288 (78300 HEX), which is the base
- location of video memory. By simply moving a block of up to 32,000 bytes of
- memory into this area, it is possible to look at each bit of that memory,
- since each bit is a pixel on the screen. Doing this a few times per second
- makes those bits which change stand out as "motion" on the screen. So I wrote
- a two-line program in a fast language (4XFORTH--sorry, Felgercarb) which would
- move 20,000 bytes of memory to the screen about five times per second, and
- then I watched which pixels changed. Looking at the first 20,000 bytes of
- memory, the areas of memory used by GEM for the real time clock soon became
- apparent (I could see the bits counting up). Then, I moved the mouse on the
- table, and watched for new changes on the screen. There, about two inches
- down the screen, were pixels which only changed when the mouse moved.
- Estimating the position of these pixels within that 20,000, I narrowed down
- the location to within about 100 bytes, and then modified the program to
- display only those 100 bytes (at many times per second). This resulted in
- about a line and a half of pixels, and allowed me to estimate to within ten
- bytes. Repeatedly dumping these bytes to screen in hexadecimal form revealed
- the individual locations.
- Also identifiable are the locations which contain the video "under" the mouse
- icon, which immediately follow the mouse position addresses. Also, in byte
- 2418 are bits indicating the last button pushed. And, there is probably a bit
- that is set high every time the mouse is moved. I've not had time or need to
- identify these.
- This method should work for identifying the locations used by any
- interrupt-driven routine. Or, by writing the program as an interrupt-driven
- routine, we should be able to hack into any GEM function. Let's here it for
- the Hacker's Jack!
- Note: Here is the FORTH code for dumping the bottom 20,000 to the screen.
- : PIX 20000 0 DO I @ I 492288 + ! 4 +LOOP ;
- : PIXES 0 DO PIX LOOP ;
- 500 PIXES
- ATARI 520 ST MEMORY MAP
- FF8000-FFFFFF I/O ASSIGNMENTS
- FFFC06 6580 ACIA #2 (MIDI)
- FFFC00 6580 ACIA #1
- FFFA00 MFP 68901 Peripheral Controller
- FF8800 YM2149 (AY-3-8910) Sound
- FF8600 3H-2130 DMA/FDC
- FF8400 RESERVED
- FF8200 2H-2123 Video Controller
- FF8000 Data Configuration
- FF0000-FF7FFF UNUSED
- FC0000-FEFFFF 192K System Rom
- FA0000-FBFFFF 128K Expansion Cartridge
- 080000-F9FFFF UNUSED
- 000000-07FFFF 512K RAM
- 078300-07FFFF 32K Video Memory
- 00242eW YX Postion of mouse
- 00241eW Y position of mouse
- 00241cW X position of mouse
- 002418B Left/Right mouse buttons
- 0004c4 _drvbits = 3 if floppies
- 0004bc _hz_200 = 200 Hz timer tick
- 0004b4 buf1 (2 buffer-list pointers)
- 0004a6W _nflops = 0,1, or 2 floppies
- 0004a2 savptr
- 00049ew _____md (for GEMDOS)
- 00048e themd
- 000484B conterm attribute bits
- # 0 enable keyclick
- # 1 enable key-repeat
- # 2 enable bell on ^G
- 000482W _cadload
- 00047e hdv_mediach (h.disk media cha)
- 00047a hdv_boot (to boot from h.disk)
- 000476 hdv_rw (h.disk read/write)
- 000472 hdv_bpb (h.disk bios param bl)
- 00046e hdv_dsb (h.disk state block)
- 00046a hdv_init (h.disk initialize)
- 000466 _frclock (vert. blank count)
- 000462 _vbclock (vert/bl/int/count)
- 00045e screenpt nextptr b/screen mem
- 00045a colorptr pointer to pallette
- 000456 _vblqueue pointer to vblank
- 000454W nvbls number of pointers " "
- 000452W vblsem vert/blank semaphore
- 00044e _v_bas_ad ptr base screen mem
- 00044cW sshiftmd shadow for shiftmd
- =0 320x200x4 (low res)
- =1 640x200x2 (med res)
- =2 640x400x1 (hi res mono)
- 00044aB defshiftmd default video res
- 000448W palmode=0 NTSC, =1 PAL video
- 000446W _bootdev device # booted from
- 000444W _fverify floppy verify flag
- 000442W _timr_ms =$14=20d (50Hz)
- 000440W seekrate default floppy seek
- =0 6ms, =1 12ms,
- =2 2ms, =3 3ms (default)
- 00043a memval2 = $237698aa
- 000436 _memtop top of available mem
- 000432 _membot bottom of " "
- 00043a memval2 = $237698aa
- 000436 _memtop top of available mem
- 000432 _membot bottom of " "
- 00042e phystop physical top of RAM
- 00042a resvector reset bailout vector
- 000426 resvalid = $31415926
- 000424B memcntlr memory configuration
- =0 256K, =4 512K
- =5 1024K (2 banks)
- 000420 memvalid = $752019f3
- 00040c etv_xtra log.vectors $103-107
- 000408 etv_term process/term $102
- 000404 etv_critic critcal/err $101
- 000400 etv_timer timer handoff $100
- All addresses are for longwords (32 bits)
- unless suffixed with W (word=16bits) or
- B (byte=8bits).
- 000000-00003ff Exception Vectors
- 000100-0003ff 192 User-Defined Vectors
- 0000c0-0000ff Unassigned, Reserved
- 000080-0000bf Trap #0-15 Instr Vectors
- 000064-00007f Level 1-7 Interr Vectors
- 000060 Spurious Interrupt
- 000030-00005f Unassigned, Reserved
- 00002c Opcode 1111 Emulation
- 000028 Opcode 1010 Emulation
- 000024 Vector 9 - Trace
- 000020 Vector 8 - Privilege Violation
- 00001c Vector 7 - TRAPV instruction
- 000018 Vector 6 - CHK instruction
- 000014 Vector 5 - Divide by Zero
- 000010 Vector 4 - Illegal Instruction
- 00000c Vector 3 - Address Error
- 000008 Vector 2 - Bus Error
- 000004 Reset-Initial Program Counter
- 000000 Reset-Initial Stack Pointer
- Thank you, Lt. (j.g.) Christopher Biow
- Let me know if you are just sure I've made some typos.
- Don E. Farmer
-
-
- Download complete. Turn off Capture File.
-
- Download another file (Y/N)?FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF